package statePattern.spring;

/**
 * @Author : 叶荻风
 * @create : 2024/6/27 17:19
 */

import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class ReviewSuccess implements IState{
    @Resource
    ReviewFail reviewFail;
    @Override
    public void doHandler(Response response) {
        if(response.getSignal()==2){
            System.out.println("成功业务处理:"+response);
        }else{
            response.setState(reviewFail);
            response.doHandle();
        }

    }
}
